import axios from 'axios';
import { loginreq, req } from './axiosFun';

// 登录接口
export const login = (params) => { return loginreq("post", "/api/sysUser/login", params) };
export const loginout = () => { return axios.delete("/api/login?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };

/**
 * 用户管理
 **/
// 用户管理-获取用户列表
export const userList = (params) => { return req("post", "/api/sysUser/list/page", params) };

// 用户管理-保存
export const userSave = (params) => { return req("post", "/api/sysUser/save", params) };
// 用户管理-编辑
export const userEdit = (params) => { return req("post", "/api/sysUser/edit", params) };

// 用户管理-删除用户
export const userDelete = (params) => { return axios.delete("/api/sysUser/del/" + params).then(res => res.data) };
// 用户管理-修改状态
export const userStatus = (params) => { return req("post", "/api/sysUser/edit", params) };
// 用户管理-批量删除
export const userBatchDel = (params) => { return req("post", "/api/sysUser/del/batch", params) };
